library(ggplot2) # beautiful graphs

library(ggthemes) # nice themes for ggplot2

library(ggbeeswarm) # helpful 'beeswarm' geometry

library(cowplot) # arrrange graphs

library(pander) # nice tables

How to Choose a Chart

Choosing the right chart to represent your data can be a daunting process. I believe that a starting point for this thinking is some basic statistical thinking about the type of variables that you have. At the broadest level, variables may be conceptualized as categorical variables, or continuous variables.

Once we have discerned the type of variable that have, there are two followup questions we may ask before deciding upon a chart strategy:

A Few Notes

A Note About Graph Labels

Graphs should have clear titles and labels.

A Simulated Data File of Continuous and Categorical Data

A few randomly selected observations…

  x y z u v w s q
832 108.9 117.7 112.8 Group B Group B Group A Group 1 118.9
948 73.05 116.3 124.6 Group B Group B Group A Group 1 83.05
889 98.09 80.04 90.32 Group B Group B Group A Group 2 118.1
253 101.8 127.2 101.1 Group B Group B Group A Group 2 121.8
802 89.6 75.21 87.56 Group B Group B Group A Group 2 109.6
746 90.84 97.51 76.83 Group B Group A Group A Group 2 110.8
391 111.9 76.77 49.39 Group A Group B Group A Group 3 141.9
810 138 119.7 75.13 Group B Group B Group A Group 2 158
192 202.1 143.6 95.19 Group B Group B Group B Group 1 212.1
901 123.9 54.12 99.33 Group B Group B Group A Group 3 153.9

One Thing At A Time           Two Things At A Time

Continuous           Continuous By Categorical

One Thing At A Time           Two Things At A Time

Categorical           Categorical By Categorical

Continuous by Continuous

Graphics made with the ggplot2 graphing library created by Hadley Wickham.

Available online at https://agrogan1.github.io/

How to Choose a Chart by Andrew Grogan-Kaylor is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. You are welcome to download and use this handout in your own classes, or work, as long as the handout remains properly attributed.

Last updated: October 01 2019 at 14:55